package com.student.model;

import org.springframework.data.jpa.repository.JpaRepository;

import javax.transaction.Transactional;
import java.util.List;


@Transactional
public interface TeacherDAO extends JpaRepository<Teacher,Integer> {
    boolean existsByPhone(String phone); //根据教工号判断是否已经存在

    boolean existsByPhoneAndPassword(String phone,String password);  //验证账号和密码

    void deleteByPhone(String phone);  //根据教师账号删除这个教师

    Teacher findTeacherByPhone(String phone); //根据教工号(手机号)查一个教师
    //List<Teacher> findAll();   查回所有的教师,默认的可以不显式的写出来来
}
